package com.isoft.util;

import java.util.Random;

public class IdentifyingCodeUtil {
    private static final Random random = new Random();
    private static final int CODE_LENGTH = 6;

    /*生成六位数字验证码*/
    public static String getCode() {
        StringBuilder codeBuilder = new StringBuilder(CODE_LENGTH);
        for (int i = 0; i < CODE_LENGTH; i++) {
            // 生成0到9之间的随机数，并转换为字符串追加到构建器中
            codeBuilder.append(random.nextInt(10));
        }
        return codeBuilder.toString();
    }
}
